home *** CD-ROM | disk | FTP | other *** search
File List | 1987-03-29 | 18.3 KB | 557 lines |
- INT 20 Program terminate
- Entry: CS->PSP
- Exit: Does not return to caller
-
- INT 21 Execute DOS function
- 00 Program terminate
- Entry: CS->PSP
- Exit: Does not return to caller
- 01 Character input
- Entry: None
- Exit: AL=character
- 02 Character output
- Entry: DL=character
- Exit: None
- 03 Auxiliary input
- Entry: None
- Exit: AL=character
- 04 Auxiliary output
- Entry: DL=character
- Exit: None
- 05 Printer output
- Entry: DL=character
- Exit: None
- 06 Direct console I/O
- Entry: DL=FF for console input
- DL=character for console output
- Exit: ZF=0 if a character is ready,AL=character
- ZF=1 if no character is ready
- 07 Direct console input without echo
- Entry: None
- Exit: AL=character
- 08 Console input without echo
- Entry: None
- Exit: AL=character
- 09 Display string
- Entry: DS:DX->string ending with $
- Exit: None
- 0A Buffered keyboard input
- Entry: DS:DX->input buffer (first byte of buffer=maximum input length)
- Exit: second byte of buffer=number of characters read
- 0B Get input status
- Entry: None
- Exit: AL=00 no character available
- AL=FF character available
- 0C Reset input buffer and input
- Entry: AL=function number (01,06,07,08,0A)
- DS:DX->input buffer if function=0A
- Exit: AL=character unless function=0A
- 0D Disk reset
- Entry: None
- Exit: None
- 0E Set default drive
- Entry: DL=drive code (0=A)
- Exit: AL=number of logical drives
- 0F Open file
- Entry: DS:DX->unopened FCB
- Exit: AL=00 file opened
- AL=FF file not found
- 10 Close file
- Entry: DS:DX->opened FCB
- Exit: AL=00 file closed
- AL=FF file not found
- 11 Search for first match
- Entry: DS:DX->unopened FCB
- Exit: AL=00 matching filename found
- buffer at DTA is filled with an unopened FCB
- AL=FF matching filename not found
- 12 Search for next match
- Entry: DS:DX->unopened FCB
- Exit: AL=00 matching filename found
- buffer at DTA is filled with an unopened FCB
- AL=FF matching filename not found
- 13 Delete file
- Entry: DS:DX->unopened FCB
- Exit: AL=00 file deleted
- AL=FF matching filename not found or files are read-only
- 14 Sequential read
- Entry: DS:DX->opened FCB
- Exit: AL=00 file was read
- AL=01 EOF (no data read)
- AL=02 segment wrap
- AL=03 EOF (partial read)
- 15 Sequential write
- Entry: DS:DX->opened FCB
- Exit: AL=00 file was written
- AL=01 disk full
- AL=02 segment wrap
- 16 Create or truncate file
- Entry: DS:DX->unopened FCB
- Exit: AL=00 file created
- AL=FF directory full
- 17 Rename file
- Entry: DS:DX->modified FCB (FCB+11h->new filename)
- Exit: AL=00 file renamed
- AL=FF no matching files found or new filename already exists
- 18 Reserved
- 19 Get default drive
- Entry: None
- Exit: AL=drive code (0=A)
- 1A Set disk transfer address
- Entry: DS:DX=new DTA
- Exit: None
- 1B Get allocation info for default drive
- Entry: None
- Exit: AL=sectors/cluster
- CX=bytes/sector
- DX=clusters/drive
- DS:BX->media descriptor byte
- 1C Get allocation info for specified drive
- Entry: DL=drive code (0=default,1=A)
- Exit: AL=sectors/cluster
- CX=bytes/sector
- DX=clusters/drive
- DS:BX->media descriptor byte
- AL=FF invalid drive
- 1D Reserved
- 1E Reserved
- 1F Get disk parameter block for default drive (*)
- Entry: None
- Exit: DS:BX->disk parameter block
- 0 drive code 11 number of system sectors
- 1 unit code 13 last cluster number
- 2 bytes per sector 15 sectors per FAT
- 4 sectors per cluster-1 16 first directory sector
- 5 disk type 18 pointer to device driver
- 6 number of reserved sectors 22 media descriptor byte
- 8 number of FATs 23 reserved
- 9 number of directory entries 24 pointer to next DPB
- * disk types: 0=single sided floppy disk,2=AT fixed disk
- 1=double sided floppy disk,3=XT fixed disk
- 20 Reserved
- 21 Random read
- Entry: DS:DX->opened FCB
- Exit: AL=00 file was read
- AL=01 EOF (no data read)
- AL=02 segment wrap
- AL=03 EOF (partial read)
- 22 Random write
- Entry: DS:DX->opened FCB
- Exit: AL=00 file was written
- AL=01 disk full
- AL=02 segment wrap
- 23 Get file size in records
- Entry: DS:DX->unopened FCB
- Exit: AL=00 FCB random record field is set based on number of records
- and record size
- AL=FF file not found
- 24 Set random record number
- Entry: DS:DX->opened FCB
- Exit: random record field is set based on record size,current record
- and current block
- 25 Set interrupt vector
- Entry: DS:DX=new address
- AL=interrupt number
- Exit: None
- 26 Create program segment prefix
- Entry: DX=segment for new PSP
- Exit: None
- 27 Random block read
- Entry: DS:DX->opened FCB
- CX=number of records to read
- Exit: AL=00 file was read
- AL=01 EOF (no data read)
- AL=02 segment wrap
- AL=03 EOF (partial read)
- CX=actual number of records read
- 28 Random block write
- Entry: DS:DX->opened FCB
- CX=number of records to write
- Exit: AL=00 file was written
- AL=01 disk full
- AL=02 segment wrap
- CX=actual number of records written
- 29 Parse filename
- Entry: DS:SI->string to parse
- ES:DI->buffer for unopened FCB
- AL=flags
- Bit 3=1 modify FCB extension only if an extension is specified
- Bit 2=1 modify FCB filename only if a filename is specified
- Bit 1=1 modify FCB drive id byte only if a drive is specified
- Bit 0=1 scan off leading separators
- Exit: DS:SI->first character after parsed filename
- AL=00 no wildcard characters in string
- AL=01 wildcard characters in string
- AL=FF invalid drive
- 2A Get date
- Entry: None
- Exit: AL=day of week (0=Sun)
- CX=year
- DH=month
- DL=day
- 2B Set date
- Entry: CX=year
- DH=month
- DL=day
- Exit: AL=00 date set
- AL=FF invalid date
- 2C Get time
- Entry: None
- Exit: CH=hours
- CL=minutes
- DH=seconds
- DL=hundredths
- 2D Set time
- Entry: CH=hours
- CL=minutes
- DH=seconds
- DL=hundredths
- Exit: AL=00 time set
- AL=FF invalid time
- 2E Set verify flag
- Entry: AL=0 verify off
- AL=1 verify on
- Exit: None
- 2F Get disk transfer address
- Entry: None
- Exit: ES:BX=DTA
- 30 Get DOS version
- Entry: None
- Exit: AL=major version number
- AH=minor version number
- 31 Terminate and stay resident
- Entry: AL=return code
- DX=memory size in paragraphs
- Exit: Does not return to caller
- 32 Get disk parameter block for specified drive (*)
- Entry: DL=drive code (0=default,1=A)
- Exit: DS:BX->disk parameter block
- 0 drive code 11 number of system sectors
- 1 unit code 13 last cluster number
- 2 bytes per sector 15 sectors per FAT
- 4 sectors per cluster-1 16 first directory sector
- 5 disk type 18 pointer to device driver
- 6 number of reserved sectors 22 media descriptor byte
- 8 number of FATs 23 reserved
- 9 number of directory entries 24 pointer to next DPB
- * disk types: 0=single sided floppy disk,2=AT fixed disk
- 1=double sided floppy disk,3=XT fixed disk
- AL=FF invalid drive
- 33 Get or set Ctrl-break
- Entry: AL=0 get break
- AL=1 set break,DL=0 break off
- DL=1 break on
- Exit: DL=0 break off
- DL=1 break on
- 34 Get DOS call depth (*)
- Entry: None
- Exit: ES:BX->DOS call depth
- 35 Get interrupt vector
- Entry: AL=interrupt number
- Exit: ES:BX=interrupt address
- 36 Get free disk space
- Entry: DL=drive code (0=default,1=A)
- Exit: AX=sectors/cluster
- BX=free clusters
- CX=bytes/sector
- DX=clusters/drive
- AX=FFFF if drive invalid
- 37 Get or set switch character (*)
- Entry: AL=0 get switch character
- AL=1 set switch character,DL=new value
- Exit: DL=switch character if get request
- 38 Get or set country info
- Entry: AL=country code (0=current country)
- AL=FF,BX=country code>=255
- DS:DX->buffer for get request
- DX=FFFF set request
- Exit: CF=0 BX=country code for get request
- CF=1 AX=error code
- 39 Create subdirectory
- Entry: DS:DX->asciiz string
- Exit: CF=0 None
- CF=1 AX=error code
- 3A Remove subdirectory
- Entry: DS:DX->asciiz string
- Exit: CF=0 None
- CF=1 AX=error code
- 3B Change current directory
- Entry: DS:DX->asciiz string
- Exit: CF=0 None
- CF=1 AX=error code
- 3C Create or truncate file
- Entry: DS:DX->asciiz string
- CX=attribute byte
- Exit: CF=0 None
- CF=1 AX=error code
- 3D Open file
- Entry: DS:DX->asciiz string
- AL=open mode
- Bits 0-2 access mode
- 000=read
- 001=write
- 010=read/write
- Bit 3 reserved
- Bits 4-6 sharing mode
- 000=compatibility
- 001=read/write access denied
- 010=write access denied
- 011=read access denied
- 100=full access permitted
- Bit 7 inheritance flag
- 0=file inherited by subprocess
- 1=file private to current process
- Exit: CF=0 AX=file handle
- CF=1 AX=error code
- 3E Close file
- Entry: BX=file handle
- Exit: CF=0 None
- CF=1 AX=error code
- 3F Read file or device
- Entry: BX=file handle
- CX=bytes to read
- DS:DX->input buffer
- Exit: CF=0 AX=number of bytes read or 0 if EOF
- CF=1 AX=error code
- 40 Write file or device
- Entry: BX=file handle
- CX=bytes to write
- DS:DX->output buffer
- Exit: CF=0 AX=number of bytes written or 0 if disk full
- CF=1 AX=error code
- 41 Delete file
- Entry: DS:DX->asciiz string
- Exit: CF=0 None
- CF=1 AX=error code
- 42 Move file pointer
- Entry: AL=code (0=absolute,1=relative,2=relative to EOF)
- BX=file handle
- CX:DX=offset
- Exit: CF=0 DX:AX=new pointer
- CF=1 AX=error code
- 43 Get or set file attributes
- Entry: AL=0 get attributes
- AL=1 set attributes,CX=attribute byte
- DS:DX->asciiz string
- Exit: CF=0 CX=attribute byte if get request
- CF=1 AX=error code
- 44 I/O control for devices
- Entry: AL=function
- 00 get device info
- 01 set device info
- 02 read from character device
- 03 write to character device
- 04 read from block device
- 05 write to block device
- 06 get input status
- 07 get output status
- 08 removable media check
- 09 local/remote drive check
- 0A local/remote handle check
- 0B change sharing retry count
- BX=file handle or drive code (0=default,1=A)
- CX=number of bytes
- DS:DX->buffer for functions 02-05
- DX=device info for function 01
- Character devices: Block devices:
- Bit 0 1=console input Bit 0-5 drive code (0=A)
- 1 1=console output 6 0=file has been written
- 2 1=nul 7 0=block device
- 3 1=clock 8-15 reserved
- 4 reserved
- 5 0=ascii,1=binary
- 6 0=eof on input
- 7 1=character device
- 8-15 reserved
- Exit: CF=0 DX=device info for function 00
- AX=number of bytes for functions 02-05
- AL=status for functions 06-07 (00=not ready,FF=ready)
- AX=value for function 08 (0=removable,1=fixed)
- CF=1 AX=error code
- 45 Duplicate handle
- Entry: BX=file handle
- Exit: CF=0 AX=new file handle
- CF=1 AX=error code
- 46 Force duplicate of handle
- Entry: BX=file handle
- CX=new file handle
- Exit: CF=0 None
- CF=1 AX=error code
- 47 Get current directory
- Entry: DS:SI->64-byte buffer for pathname
- DL=drive code (0=default,1=A)
- Exit: CF=0 buffer is filled with pathname
- CF=1 AX=error code
- 48 Allocate memory
- Entry: BX=number of paragraphs to allocate
- Exit: CF=0 AX=segment of allocated block
- CF=1 AX=error code
- BX=size of largest available block
- 49 Release memory
- Entry: ES=segment of block to release
- Exit: CF=0 None
- CF=1 AX=error code
- 4A Modify allocated memory
- Entry: BX=number of paragraphs to allocate
- ES=segment of block to modify
- Exit: CF=0 AX=segment of allocated block
- CF=1 AX=error code
- BX=size of largest available block
- 4B Execute program
- Entry: AL=0 load and execute
- AL=1 load only
- AL=3 load overlay
- DS:DX->asciiz string
- ES:BX->parameter block
- AL=0,1 0 environment block segment or 0
- 2 command tail pointer
- 6 FCB1 pointer or -1
- 10 FCB2 pointer or -1
- AL=3 0 segment where file will be loaded
- 2 relocation factor
- Exit: CF=0 all registers except CS and IP are destroyed
- parameter block if load only:
- 14 SS:SP of loaded program
- 18 CS:IP of loaded program
- CF=1 AX=error code
- 4C Terminate with return code
- Entry: AL=return code
- Exit: Does not return to caller
- 4D Get return code of subprocess
- Entry: None
- Exit: AL=return code
- AH=exit type (0=normal,1=Ctrl-C,2=critical error,3=function 31h)
- 4E Find first matching file
- Entry: DS:DX->asciiz string
- CX=attribute byte
- Exit: CF=0 DTA reserved
- DTA+21 attribute byte
- DTA+22 file time
- DTA+24 file date
- DTA+26 file size
- DTA+30 filename
- CF=1 AX=error code
- 4F Find next matching file
- Entry: buffer at DTA must be set from previous 4E or 4F call
- Exit: CF=0 DTA reserved
- DTA+21 attribute byte
- DTA+22 file time
- DTA+24 file date
- DTA+26 file size
- DTA+30 filename
- CF=1 AX=error code
- 50 Set program segment prefix address (*)
- Entry: BX=segment of PSP
- Exit: None
- 51 Get program segment prefix address (*)
- Entry: None
- Exit: BX=segment of PSP
- 52 Get disk parameter block list (*)
- Entry: None
- Exit: ES:BX->disk parameter block list
- ES:(BX-2)->memory control block anchor
- 53 Create disk parameter block (*)
- Entry: DS:SI->BIOS parameter block
- ES:BP->buffer for disk parameter block
- Exit: None
- 54 Get verify flag
- Entry: None
- Exit: AL=0 verify off
- AL=1 verify on
- 55 Create duplicate program segment prefix (*)
- Entry: DX=segment for new PSP
- SI=new end of allocation
- Exit: None
- 56 Rename file
- Entry: DS:DX->asciiz string
- ES:DI->asciiz string (new filename)
- Exit: CF=0 None
- CF=1 AX=error code
- 57 Get or set file date and time
- Entry: AL=0 get date and time
- AL=1 set date and time,CX=time,DX=date
- BX=file handle
- Exit: CF=0 CX=time if get request
- DX=date if get request
- CF=1 AX=error code
- 58 Get or set allocation strategy
- Entry: AL=0 get strategy
- AL=1 set strategy,BX=code (0=first fit,1=best fit,2=last fit)
- Exit: CF=0 AX=strategy code if get request
- CF=1 AX=error code
- 59 Get extended error info
- Entry: None
- Exit: AX=extended error code
- BH=error class
- BL=suggested action
- CH=locus
- 5A Create unique file
- Entry: DS:DX->asciiz string (path ending with \)
- CX=attribute byte
- Exit: CF=0 AX=file handle (filename is appended to path)
- CF=1 AX=error code
- 5B Create new file
- Entry: DS:DX->asciiz string
- CX=attribute byte
- Exit: CF=0 AX=file handle
- CF=1 AX=error code
- 5C Lock or unlock a file
- Entry: AL=0 lock
- AL=1 unlock
- BX=file handle
- CX:DX=region offset
- SI:DI=region length
- Exit: CF=0 None
- CF=1 AX=error code
- 5D Reserved (?)
- 60 Parse filename extended (*)
- Entry: DS:SI->asciiz string
- ES:DI->buffer for parsed string
- Exit: CF=0 buffer is filled with parsed string
- CF=1 AX=error code
- 61 Reserved
- 62 Get program segment prefix address
- Entry: None
- Exit: BX=segment of PSP
- 63 Reserved
- 64 Reserved (?)
-
- INT 25 Absolute disk read
- Entry: AL=drive number (0=A)
- CX=number of sectors
- DX=starting sector number
- DS:BX->input buffer
- Exit: All registers except the segment registers and SP may be destroyed
- CF=0 None
- CF=1 AX=error code
- Note: The original flags are still on the stack after an INT 25
-
- INT 26 Absolute disk write
- Entry: AL=drive number (0=A)
- CX=number of sectors
- DX=starting sector number
- DS:BX->output buffer
- Exit: All registers except the segment registers and SP may be destroyed
- CF=0 None
- CF=1 AX=error code
- Note: The original flags are still on the stack after an INT 26
-
- INT 27 Terminate and stay resident
- Entry: DX->last byte to stay resident+1
- Exit: Does not return to caller
-
- INT 28 Execute background task (*)
- Entry: None
- Exit: None
- Note: This interrupt is called by DOS while waiting for input
- INT 28 is normally a nop but may be intercepted by any program
- that needs to be run as a background task
-
- INT 29 ANSI.SYS character output (*)
- Entry: AL=character
- Exit: None
-
- INT 2E Execute command (*)
- Entry: DS:SI->command string-1 followed by a carriage return
- Exit: All registers except CS and IP are destroyed